package com.kerbores.blog.service.impl;

import java.util.List;

import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;

import com.kerbores.blog.bean.Comment;
import com.kerbores.blog.dao.ICommentDao;
import com.kerbores.blog.service.ICommentService;

/**
 * @author Ixion <br>
 *         create at 2014年11月1日
 */
@IocBean(name = "commentService")
public class CommentServiceImpl implements ICommentService {
	@Inject
	private ICommentDao commentDao;

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.kerbores.blog.service.ICommentService#submit(com.kerbores.blog.bean
	 * .Comment)
	 */
	@Override
	public boolean submit(Comment comment) {
		return commentDao.save(comment) != null;
	}

	/* (non-Javadoc)
	 * @see com.kerbores.blog.service.ICommentService#findByArticleId(int)
	 */
	@Override
	public List<Comment> findByArticleId(int id) {
		return commentDao.findByArticleId(id);
	}
}
